package com.qianxunclub.chapter4.netty;

import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;

public class DateDemo {
    public static void main(String[] args) {
        String text = "2018-11-05T20:17:26.915047494+08:00";
        OffsetDateTime offsetDateTime = OffsetDateTime.parse(text);
        System.out.println(offsetDateTime);

        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
        OffsetDateTime date = dateTimeFormatter.parse(text, OffsetDateTime::from);
        System.out.println(date);
    }
}
